
package hasthi.container;

import org.apache.xmlbeans.XmlObject;

public abstract class AbstractMessageContext implements MessageContext {
    protected NodeAddress address;
    protected String soapEndpoint;
    
    protected XmlObject request;
    protected String soapAction;
    
    protected String xsltTransformation;
    
    
    
    public AbstractMessageContext(String soapAddress) {
        this.address = new NodeAddress(soapAddress);
        this.soapEndpoint = soapAddress;
    }
    
    public AbstractMessageContext(NodeAddress address) {
        super();
        this.address = address;
    }
    public NodeAddress getAddress() {
        if(address == null && soapEndpoint != null){
            address = new NodeAddress(soapEndpoint);
        }
        return address;
    }
    public XmlObject getRequest() {
        return request;
    }
    public String getSoapAction() {
        return soapAction;
    }
    public String getSoapEndpoint() {
        if(soapEndpoint == null && address != null){
            return address.getAddressAsString();
        }else{
            return soapEndpoint;    
        }
    }

    public void setSoapAction(String soapAction) {
        this.soapAction = soapAction;
    }

    public void setSoapEndpoint(String soapEndpoint) {
        this.soapEndpoint = soapEndpoint;
    }
}

